<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core" 
	template="/template/template.xhtml">
	
	<ui:define name="menu"> 
		<ui:include src="/template/menu_admin.xhtml"/>
	</ui:define>
	
	<ui:define name="conteudo">  
		<h:form>
			<br/>
				<h:dataTable value="#{ fornecedorMBean.colecao }" width="100%" var="pi" border="1">
					<f:facet name="caption">Lista dos Fornecedores Cadastradas</f:facet>					
					
					<h:column>
						<f:facet name="header">
							CPF/CNPJ
						</f:facet>
						<h:outputText value="#{ pi.cpf }" />
						<h:outputText value="#{ pi.cnpj }" />
					</h:column>
					<h:column>
						<f:facet name="header">
							Nome
						</f:facet>
						<h:outputText value="#{ pi.nome }" />
					</h:column>
					<h:column>
						<f:facet name="header">
							Nome Fantasia
						</f:facet>
						<h:outputText value="#{ pi.nomeFantasia }" />
					</h:column>
					<h:column>
						<h:commandLink value="Alterar" action="#{ fornecedorMBean.preAlterar }"/>
					</h:column>
					<h:column>
						<h:commandLink value="Remover" action="#{ fornecedorMBean.remover }" onclick="return confirm('Deseja realmente remover?');" />						
					</h:column>
				</h:dataTable>
			<br />
		</h:form>
	</ui:define>
			
	<ui:define name="rodape">  
		<ui:include src="/template/rodape.xhtml"/> 
	</ui:define>

</ui:composition>